using SqlQueryBuilder.Clauses;

namespace SqlQueryBuilder.Criterias
{
    /// <summary>
    /// Where Criteria
    /// </summary>
    public class Where : ICriteria
    {
        /// <summary>
        /// Gets or sets the whereclause.
        /// </summary>
        /// <value>The whereclause.</value>
        public IConditionalClause whereclause { get; set; }

        /// <summary>
        /// Builds the criteria.
        /// </summary>
        /// <returns></returns>
        public string BuildCriteria()
        {
            return whereclause != null ? 
                string.Format("WHERE {0} ", whereclause.BuildConditionalClause()) : "";
        }
    }
}